package com.heiye.quiz.biz.constant;

/**
 * @author: heiye
 * @date: 2025/03/18 下午8:30
 * @version: v1.0.0
 * @description: TODO
 */
public class RedisKeyConstants {

    /**
     * 问题详情 KEY 前缀
     */
    private static final String QUIZ_DETAIL_KEY = "quiz:detail:";

    /**
     * 问题简要 KEY 前缀
     */
    private static final String QUIZ_BRIEF_KEY = "quiz:brief:";

    /**
     * 构建完整的问题详情 KEY
     *
     * @param quizId
     * @return
     */
    public static String buildQuizDetailKey(Long quizId) {
        return QUIZ_DETAIL_KEY + quizId;
    }

    /**
     * Roaring Bitmap：用户笔记点赞 前缀
     */
    public static final String R_BITMAP_USER_QUIZ_LIKE_LIST_KEY = "rbitmap:quiz:likes:";


    /**
     * 构建完整的问题简要 KEY
     *
     * @param quizId
     * @return
     */
    public static String buildQuizBriefKey(Long quizId) {
        return QUIZ_BRIEF_KEY + quizId;
    }

    /**
     * 构建完整的 Roaring Bitmap：用户笔记点赞 KEY
     *
     * @param userId
     * @return
     */
    public static String buildRBitmapUserQuizLikeListKey(Long userId) {
        return R_BITMAP_USER_QUIZ_LIKE_LIST_KEY + userId;
    }
}
